//
//  DGCirculardiagramViewController.m
//  DGChartDraw
//
//  Created by yidong on 16/11/4.
//  Copyright © 2016年 东哥. All rights reserved.
//

#import "DGCirculardiagramViewController.h"
#import "DGCirculardiagramView.h"

@interface DGCirculardiagramViewController ()

@end

@implementation DGCirculardiagramViewController

- (void)viewDidLoad {
    
    
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    DGCirculardiagramView *pie1 = [[DGCirculardiagramView alloc] initWithFrame:CGRectMake(0,250,self.view.frame.size.width, 200)];
    
    pie1.backgroundColor = [UIColor whiteColor];
    
    NSString *all =   @"900";
    NSString *part1 = @"300";
    NSString *part2 = @"400";
    NSString *part3 = @"200";
    
    
    float scale1 = [part1 intValue]/[all floatValue];
    
    float  scale2 = [part2 intValue]/[all floatValue];
    
    float  scale3 = [part3 intValue]/[all floatValue];
    
    
    pie1.descriptionArray = @[@{@"num":part1,@"des":@"新手任务"},@{@"num":part2,@"des":@"超级任务"},@{@"num":part3,@"des":@"日常任务"}];
    
    pie1.ratioArray = @[[NSString stringWithFormat:@"%f",scale1],[NSString stringWithFormat:@"%f",scale2],[NSString stringWithFormat:@"%f",scale3]];
    
    pie1.colorArray = @[
                        [UIColor colorWithRed:247/255.0 green:86/255.0 blue:74/255.0 alpha:1],
                        
                        [UIColor colorWithRed:247/255.0 green:152/255.0 blue:51/255.0 alpha:1],
                        
                        [UIColor colorWithRed:55/255.0 green:115/255.0 blue:191/255.0 alpha:1]];
    
    
    [self.view addSubview:pie1];
}

@end
